

- C Programs
- C Programs - Home
Basics of C Programming (Introductory Programs)
- Hello World
- Print your name, age, and address
- Display "C Programming is Powerful"
- Input and display integer, float, and character
- Swap two numbers (using third variable)
- Swap two numbers (without third variable)
- Find ASCII value of a character
- Find size of data types (int, float, etc.)
- Convert Celsius to Fahrenheit
- Convert Fahrenheit to Celsius
- Convert kilometers to miles
- Area and perimeter of a rectangle
- Area and circumference of a circle
- Menu-Driven Shape Calculations
- Menu-Driven Geometry Calculations
- Menu-Driven Extended Geometry Calculations
- Volume of a cube
- Volume of a cylinder
- Simple interest calculation
- Compound interest calculation
- Calculate gross salary
- Convert days to years, weeks, days
- Evaluate arithmetic expression
- Display ASCII table
Control Statements & Loops in C
- Decision Making Programs in C
- Check whether a number is positive, negative, or zero
- Check whether a number is even or odd
- Find the largest of two numbers
- Find the largest of three numbers
- Check whether a year is a leap year
- Check whether a character is a vowel or consonant
- Check whether a character is uppercase, lowercase, digit, or special symbol
- Find the grade of a student (marks-based)
- Check whether a person is eligible to vote
- Find absolute value of a number
- Simple calculator using if-else
- Simple calculator using switch-case
- Print day of week (switch-case)
- Check whether triangle is valid (angles sum = 180)
- Check whether triangle is equilateral, isosceles, or scalene
- Find roots of quadratic equation
- Electricity bill calculation (slab-based)
- Calculate bonus for employee based on salary & service years
- Check whether a character is alphabet or not
- Check whether a number is divisible by 5 and 11
- Menu-driven program: area of circle, rectangle, triangle
- Find greatest among four numbers (nested if)
- Loop Programs in C
- Print first N natural numbers
- Print first N even numbers
- Print first N odd numbers
- Print multiplication table of a number
- Print sum of first N natural numbers
- Print sum of first N even numbers
- Print sum of first N odd numbers
- Print factorial of a number (loop)
- Generate Fibonacci series up to N terms
- Print reverse of a number
- Count digits in a number
- Sum of digits of a number
- Product of digits of a number
- Check whether a number is palindrome (loop)
- Check whether a number is Armstrong (loop)
- Check whether a number is prime (loop)
- Print all prime numbers between 1 and N
- Print all Armstrong numbers between 1 and N
- Print all palindrome numbers in a given range
- Print all factors of a number
- Find HCF (GCD) of two numbers (loop)
- Find LCM of two numbers (loop)
- Print pyramid pattern (star *)
- Print inverted pyramid pattern
- Print Floyd’s triangle (1, 2, 3…)
- Print Pascal’s triangle (loop)
Functions
- Function to add two numbers
- Function to subtract two numbers
- Function to multiply two numbers
- Function to divide two numbers
- Function for factorial (iteration)
- Factorial (recursion)
- Fibonacci (recursion)
- GCD using function
- LCM using function
- Swap numbers using function
- Prime number check using function
- Palindrome check using function
- Armstrong check using function
- Function returning array maximum
- Recursive sum of digits
- Recursive reverse of number
- Recursive power calculation
- Function to check strong number
- Function for perfect number
- Function overloading using macros (simulate)
- Nested function calls example
Arrays
- Input and display array elements
- Sum of array elements
- Average of array elements
- Maximum in array
- Minimum in array
- Linear search
- Binary search
- Bubble sort
- Selection sort
- Insertion sort
- Merge two arrays
- Copy array to another
- Reverse array elements
- Count even and odd numbers in array
- Frequency of array elements
- Remove duplicate elements
- Find second largest element
- Find second smallest element
- Rotate array left
- Rotate array right
- Matrix addition (2D array)
- Matrix multiplication (2D array)
- Transpose of a matrix
Strings
- Input and display string
- Find string length (without strlen())
- Copy string (without strcpy())
- Concatenate two strings
- Compare two strings
- Reverse string
- Check palindrome string
- Count vowels, consonants
- Count digits, spaces, special chars
- Count words in string
- Convert string to uppercase
- Convert string to lowercase
- Toggle case of characters
- Find frequency of characters
- Remove vowels from string
- Remove spaces from string
- Remove duplicate characters
- Check anagram strings
- Sort characters in string
- Sort array of strings
- Longest word in a sentence
- Shortest word in a sentence
Pointers
- Pointer basics (address, value)
- Pointer arithmetic
- Add two numbers using pointers
- Swap numbers using pointers
- Sum of array using pointers
- Find length of string using pointers
- Reverse string using pointers
- Compare two strings using pointers
- Concatenate strings using pointers
- Pointer to pointer (double pointer)
- Function returning pointer
- Pass array to function using pointers
- Dynamic array with pointers
- Matrix addition using pointers
- Matrix multiplication using pointers
- Pointer to structure
- Access structure elements with pointer
- Array of pointers
- String array with pointers
- Pointer and function (call by reference)
- Swap two arrays using pointers
Structures and Unions
- Student structure (input & display)
- Array of structures (students list)
- Nested structures (employee with address)
- Passing structure to function
- Returning structure from function
- Complex number addition using structures
- Compare two dates using structures
- Bank account management (structure)
- Store book details using structure
- Store employee details (salary, age, etc.)
- Find student with highest marks (array of structures)
- Sort students by marks
- Union example (memory sharing)
- Difference between union & structure (demo)
- Store cricket players’ details
- Store car details (company, model, price)
- Store hospital patient details
- Online shopping cart using structures
- Store weather report data
- Library management using structures
- Store exam records with pass/fail result
Dynamic Memory Allocation
- Allocate array using malloc()
- Allocate array using calloc()
- Reallocate array using realloc()
- Free memory using free()
- Input & print dynamic array
- Average of dynamic array
- Dynamic string input
- Reverse string using dynamic memory
- Dynamic matrix allocation
- Matrix addition using dynamic memory
- Matrix multiplication using dynamic memory
- Dynamic structure allocation (student info)
- Linked list creation with malloc()
- Insert node dynamically in linked list
- Delete node dynamically in linked list
- Stack using dynamic memory
- Queue using dynamic memory
- Dynamic 2D array (pointer-to-pointer)
- Dynamic array resizing at runtime
- Dynamic sorting of array
- Dynamic string concatenation
File Handling
- Create and write to a file
- Read from a file
- Append to a file
- Copy file contents
- Count characters in file
- Count words in file
- Count lines in file
- Count vowels/consonants in file
- Check whether file exists
- Merge two files into one
- Find frequency of a word in file
- Store student records in file
- Retrieve student records from file
- Update student record in file
- Delete student record from file
- Sort student records stored in file
- Encrypt file content
- Decrypt file content
- Find largest word in a file
- Find smallest word in a file
- Store employee payroll system in file
- Implement mini database using file handling
Data Structures in C
- Singly linked list creation
- Display linked list
- Insert node at beginning
- Insert node at end
- Insert node at position
- Delete node from beginning
- Delete node from end
- Delete node by value
- Search element in linked list
- Count nodes in linked list
- Reverse linked list
- Doubly linked list creation
- Circular linked list creation
- Stack using array
- Stack using linked list
- Queue using array
- Queue using linked list
- Circular queue implementation
- Binary tree creation
- Inorder traversal
- Preorder traversal
- Postorder traversal
- Binary search tree insertion
- BST search element
- Graph representation (adjacency matrix)
- BFS (Breadth First Search)
- DFS (Depth First Search)
- Bubble sort
- Quick sort
- Merge sort
- Heap sort
- Binary search
- Hash table basics
Advanced C Programs
- Command line arguments sum
- Command line arguments word count
- Display environment variables
- Bitwise AND, OR, XOR
- Bitwise left shift, right shift
- Check if number is power of 2
- Find number of set bits (Brian Kernighan’s algorithm)
- Endianness check
- Macro definition demo
- Create header file and include it
- Error handling using errno
- Pointer to function example
- Function pointer for callback
- Matrix multiplication (optimized)
- Sparse matrix representation
- Polynomial addition using linked list
- Polynomial multiplication using linked list
- Mini calculator with functions + switch
- Tic-tac-toe game
- Snake game (console-based)
- Student grading system with structures + files
- Hospital management mini project
- Bank management mini project
User-Defined Number Programs in C
- Check whether a number is even or odd
- Find the largest of two numbers (without built-in max)
- Find the largest of three numbers
- Check whether a number is prime
- Display all prime numbers between 1 and N
- Check whether a number is palindrome
- Check whether a number is Armstrong
- Find factorial of a number (loop)
- Factorial using recursion
- Generate Fibonacci series (loop)
- Generate Fibonacci series (recursion)
- Reverse a number
- Sum of digits of a number
- Product of digits of a number
- Count digits in a number
- Find GCD of two numbers (loop)
- Find LCM of two numbers
- Check whether a number is strong (sum of factorial of digits = number)
- Check whether a number is perfect (sum of divisors = number)
- Find power of a number (without pow())
- Convert decimal to binary
- Convert binary to decimal
- Convert octal to decimal
- Convert decimal to octal
- Convert decimal to hexadecimal
- Check whether number is automorphic (square ends with same digits)
- Check whether number is neon (sum of digits of square = number)
- Print factors of a number
- Sum of N natural numbers (loop)
- Sum of N natural numbers (recursion)
User-Defined String Programs in C
- Find length of a string (without strlen())
- Copy one string to another (without strcpy())
- Concatenate two strings (without strcat())
- Compare two strings (without strcmp())
- Reverse a string (user-defined)
- Check whether a string is palindrome
- Convert string to uppercase (without strupr())
- Convert string to lowercase (without strlwr())
- Toggle case of each character
- Count vowels in a string
- Count consonants in a string
- Count digits in a string
- Count special characters in a string
- Count words in a string
- Remove all vowels from a string
- Remove all spaces from a string
- Remove duplicate characters
- Frequency of each character in string
- Find the longest word in a sentence
- Find the shortest word in a sentence
- Sort characters of string in ascending order
- Sort array of strings alphabetically
- Check whether two strings are anagrams
- Find first non-repeating character
- Replace a character in a string with another
- Remove particular character from string
- Count occurrences of a given word in string
- Check substring existence (without strstr())
- Extract substring (user-defined)
- Rotate string left/right by N characters
(using if, if-else, nested if, switch-case)
(using for, while, do-while loops)

![]() Share with a Friend |
C Programs
- C Programs
- C Programs - Home
Basics of C Programming (Introductory Programs)
- Hello World
- Print your name, age, and address
- Display "C Programming is Powerful"
- Input and display integer, float, and character
- Swap two numbers (using third variable)
- Swap two numbers (without third variable)
- Find ASCII value of a character
- Find size of data types (int, float, etc.)
- Convert Celsius to Fahrenheit
- Convert Fahrenheit to Celsius
- Convert kilometers to miles
- Area and perimeter of a rectangle
- Area and circumference of a circle
- Menu-Driven Shape Calculations
- Menu-Driven Geometry Calculations
- Menu-Driven Extended Geometry Calculations
- Volume of a cube
- Volume of a cylinder
- Simple interest calculation
- Compound interest calculation
- Calculate gross salary
- Convert days to years, weeks, days
- Evaluate arithmetic expression
- Display ASCII table
Control Statements & Loops in C
- Decision Making Programs in C
- Check whether a number is positive, negative, or zero
- Check whether a number is even or odd
- Find the largest of two numbers
- Find the largest of three numbers
- Check whether a year is a leap year
- Check whether a character is a vowel or consonant
- Check whether a character is uppercase, lowercase, digit, or special symbol
- Find the grade of a student (marks-based)
- Check whether a person is eligible to vote
- Find absolute value of a number
- Simple calculator using if-else
- Simple calculator using switch-case
- Print day of week (switch-case)
- Check whether triangle is valid (angles sum = 180)
- Check whether triangle is equilateral, isosceles, or scalene
- Find roots of quadratic equation
- Electricity bill calculation (slab-based)
- Calculate bonus for employee based on salary & service years
- Check whether a character is alphabet or not
- Check whether a number is divisible by 5 and 11
- Menu-driven program: area of circle, rectangle, triangle
- Find greatest among four numbers (nested if)
- Loop Programs in C
- Print first N natural numbers
- Print first N even numbers
- Print first N odd numbers
- Print multiplication table of a number
- Print sum of first N natural numbers
- Print sum of first N even numbers
- Print sum of first N odd numbers
- Print factorial of a number (loop)
- Generate Fibonacci series up to N terms
- Print reverse of a number
- Count digits in a number
- Sum of digits of a number
- Product of digits of a number
- Check whether a number is palindrome (loop)
- Check whether a number is Armstrong (loop)
- Check whether a number is prime (loop)
- Print all prime numbers between 1 and N
- Print all Armstrong numbers between 1 and N
- Print all palindrome numbers in a given range
- Print all factors of a number
- Find HCF (GCD) of two numbers (loop)
- Find LCM of two numbers (loop)
- Print pyramid pattern (star *)
- Print inverted pyramid pattern
- Print Floyd’s triangle (1, 2, 3…)
- Print Pascal’s triangle (loop)
Functions
- Function to add two numbers
- Function to subtract two numbers
- Function to multiply two numbers
- Function to divide two numbers
- Function for factorial (iteration)
- Factorial (recursion)
- Fibonacci (recursion)
- GCD using function
- LCM using function
- Swap numbers using function
- Prime number check using function
- Palindrome check using function
- Armstrong check using function
- Function returning array maximum
- Recursive sum of digits
- Recursive reverse of number
- Recursive power calculation
- Function to check strong number
- Function for perfect number
- Function overloading using macros (simulate)
- Nested function calls example
Arrays
- Input and display array elements
- Sum of array elements
- Average of array elements
- Maximum in array
- Minimum in array
- Linear search
- Binary search
- Bubble sort
- Selection sort
- Insertion sort
- Merge two arrays
- Copy array to another
- Reverse array elements
- Count even and odd numbers in array
- Frequency of array elements
- Remove duplicate elements
- Find second largest element
- Find second smallest element
- Rotate array left
- Rotate array right
- Matrix addition (2D array)
- Matrix multiplication (2D array)
- Transpose of a matrix
Strings
- Input and display string
- Find string length (without strlen())
- Copy string (without strcpy())
- Concatenate two strings
- Compare two strings
- Reverse string
- Check palindrome string
- Count vowels, consonants
- Count digits, spaces, special chars
- Count words in string
- Convert string to uppercase
- Convert string to lowercase
- Toggle case of characters
- Find frequency of characters
- Remove vowels from string
- Remove spaces from string
- Remove duplicate characters
- Check anagram strings
- Sort characters in string
- Sort array of strings
- Longest word in a sentence
- Shortest word in a sentence
Pointers
- Pointer basics (address, value)
- Pointer arithmetic
- Add two numbers using pointers
- Swap numbers using pointers
- Sum of array using pointers
- Find length of string using pointers
- Reverse string using pointers
- Compare two strings using pointers
- Concatenate strings using pointers
- Pointer to pointer (double pointer)
- Function returning pointer
- Pass array to function using pointers
- Dynamic array with pointers
- Matrix addition using pointers
- Matrix multiplication using pointers
- Pointer to structure
- Access structure elements with pointer
- Array of pointers
- String array with pointers
- Pointer and function (call by reference)
- Swap two arrays using pointers
Structures and Unions
- Student structure (input & display)
- Array of structures (students list)
- Nested structures (employee with address)
- Passing structure to function
- Returning structure from function
- Complex number addition using structures
- Compare two dates using structures
- Bank account management (structure)
- Store book details using structure
- Store employee details (salary, age, etc.)
- Find student with highest marks (array of structures)
- Sort students by marks
- Union example (memory sharing)
- Difference between union & structure (demo)
- Store cricket players’ details
- Store car details (company, model, price)
- Store hospital patient details
- Online shopping cart using structures
- Store weather report data
- Library management using structures
- Store exam records with pass/fail result
Dynamic Memory Allocation
- Allocate array using malloc()
- Allocate array using calloc()
- Reallocate array using realloc()
- Free memory using free()
- Input & print dynamic array
- Average of dynamic array
- Dynamic string input
- Reverse string using dynamic memory
- Dynamic matrix allocation
- Matrix addition using dynamic memory
- Matrix multiplication using dynamic memory
- Dynamic structure allocation (student info)
- Linked list creation with malloc()
- Insert node dynamically in linked list
- Delete node dynamically in linked list
- Stack using dynamic memory
- Queue using dynamic memory
- Dynamic 2D array (pointer-to-pointer)
- Dynamic array resizing at runtime
- Dynamic sorting of array
- Dynamic string concatenation
File Handling
- Create and write to a file
- Read from a file
- Append to a file
- Copy file contents
- Count characters in file
- Count words in file
- Count lines in file
- Count vowels/consonants in file
- Check whether file exists
- Merge two files into one
- Find frequency of a word in file
- Store student records in file
- Retrieve student records from file
- Update student record in file
- Delete student record from file
- Sort student records stored in file
- Encrypt file content
- Decrypt file content
- Find largest word in a file
- Find smallest word in a file
- Store employee payroll system in file
- Implement mini database using file handling
Data Structures in C
- Singly linked list creation
- Display linked list
- Insert node at beginning
- Insert node at end
- Insert node at position
- Delete node from beginning
- Delete node from end
- Delete node by value
- Search element in linked list
- Count nodes in linked list
- Reverse linked list
- Doubly linked list creation
- Circular linked list creation
- Stack using array
- Stack using linked list
- Queue using array
- Queue using linked list
- Circular queue implementation
- Binary tree creation
- Inorder traversal
- Preorder traversal
- Postorder traversal
- Binary search tree insertion
- BST search element
- Graph representation (adjacency matrix)
- BFS (Breadth First Search)
- DFS (Depth First Search)
- Bubble sort
- Quick sort
- Merge sort
- Heap sort
- Binary search
- Hash table basics
Advanced C Programs
- Command line arguments sum
- Command line arguments word count
- Display environment variables
- Bitwise AND, OR, XOR
- Bitwise left shift, right shift
- Check if number is power of 2
- Find number of set bits (Brian Kernighan’s algorithm)
- Endianness check
- Macro definition demo
- Create header file and include it
- Error handling using errno
- Pointer to function example
- Function pointer for callback
- Matrix multiplication (optimized)
- Sparse matrix representation
- Polynomial addition using linked list
- Polynomial multiplication using linked list
- Mini calculator with functions + switch
- Tic-tac-toe game
- Snake game (console-based)
- Student grading system with structures + files
- Hospital management mini project
- Bank management mini project
User-Defined Number Programs in C
- Check whether a number is even or odd
- Find the largest of two numbers (without built-in max)
- Find the largest of three numbers
- Check whether a number is prime
- Display all prime numbers between 1 and N
- Check whether a number is palindrome
- Check whether a number is Armstrong
- Find factorial of a number (loop)
- Factorial using recursion
- Generate Fibonacci series (loop)
- Generate Fibonacci series (recursion)
- Reverse a number
- Sum of digits of a number
- Product of digits of a number
- Count digits in a number
- Find GCD of two numbers (loop)
- Find LCM of two numbers
- Check whether a number is strong (sum of factorial of digits = number)
- Check whether a number is perfect (sum of divisors = number)
- Find power of a number (without pow())
- Convert decimal to binary
- Convert binary to decimal
- Convert octal to decimal
- Convert decimal to octal
- Convert decimal to hexadecimal
- Check whether number is automorphic (square ends with same digits)
- Check whether number is neon (sum of digits of square = number)
- Print factors of a number
- Sum of N natural numbers (loop)
- Sum of N natural numbers (recursion)
User-Defined String Programs in C
- Find length of a string (without strlen())
- Copy one string to another (without strcpy())
- Concatenate two strings (without strcat())
- Compare two strings (without strcmp())
- Reverse a string (user-defined)
- Check whether a string is palindrome
- Convert string to uppercase (without strupr())
- Convert string to lowercase (without strlwr())
- Toggle case of each character
- Count vowels in a string
- Count consonants in a string
- Count digits in a string
- Count special characters in a string
- Count words in a string
- Remove all vowels from a string
- Remove all spaces from a string
- Remove duplicate characters
- Frequency of each character in string
- Find the longest word in a sentence
- Find the shortest word in a sentence
- Sort characters of string in ascending order
- Sort array of strings alphabetically
- Check whether two strings are anagrams
- Find first non-repeating character
- Replace a character in a string with another
- Remove particular character from string
- Count occurrences of a given word in string
- Check substring existence (without strstr())
- Extract substring (user-defined)
- Rotate string left/right by N characters
(using if, if-else, nested if, switch-case)
(using for, while, do-while loops)